package com.hollycrm.hollysqm.handle.dao;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;

import com.hollycrm.hollysqm.entities.TblVocCustcontinfo;
/**
 * V8接触记录数据访问层
 * @author jianglong
 * @date 2017年3月29日 下午3:14:49
 */
public interface CustcontinfoDao extends CrudRepository<TblVocCustcontinfo, Integer>  {

	/**
	 * 查询指定质检计划的接触记录信息
	 * @param planId
	 * @return
	 */
	@Query("select t from TblVocCustcontinfo t where custcontinfoId in (select dataId from TblQmPlanExtract where planId=:planId)")
	public List<TblVocCustcontinfo> getCustcontinfoList(@Param("planId") String planId);
	
	/**
	 * 查询指定质检计划的接触记录信息
	 * @param planId
	 * @param rows
	 * @param start
	 * @return
	 */
//	@Query("select t from TblVocCustcontinfo t where custcontinfoId in ("
//			+ "select dateId from (select dataId,rownum as rn from TblQmPlanExtract where planId=:planId and rownum<=:rows)) where rn>:start")
//	public List<TblVocCustcontinfo> getCustcontinfoList(@Param("planId") String planId,@Param("start") int start,@Param("rows") int rows);	
			
}
